# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-term-menu
_pkgname=Term-Menu
pkgver=0.10
pkgrel=13
pkgdesc='Perl extension for asking questions and printing menus at the terminal.'
arch=('any')
url='https://metacpan.org/pod/Term::Menu'
license=('PerlArtistic' 'GPL')
depends=('perl')
options=(!emptydirs)
source=("http://search.cpan.org/CPAN/authors/id/D/DA/DAZJORZ/$_pkgname-$pkgver.tar.gz")
sha512sums=('682b4e2d5e64b0ef11a3b07cbd6701e132e278ab1a4ac4c5071864f47bed0ae7931eb687bdf07f5676f5d4ab31ba1d4bab79a19f7b6aab0a3bee727fcf0cd474')

build() {
  cd "$_pkgname-$pkgver"

  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

  /usr/bin/perl Makefile.PL INSTALLDIRS=vendor

  make
}

package() {
  cd "$_pkgname-$pkgver"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

